home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / status.h < prev    next >
C/C++ Source or Header  |  1992-09-21  |  9KB  |  222 lines

  1. /*
  2.  * status.h --
  3.  *
  4.  *     Define the statuses that are returned from modules.
  5.  *
  6.  *    The fields of a status value are defined in the following way:
  7.  *
  8.  *    MSB                  LSB
  9.  *    +--------+----------+----------+
  10.  *    |Pub/Priv| Module # | Message #|
  11.  *    +--------+----------+----------+
  12.  *      1 bit    15 bits     16 bits
  13.  *
  14.  *    The Pub/Priv bit if 0 is used to specify that the status is
  15.  *        public and can be used by other modules.
  16.  *    The Pub/Priv bit if 1 is used to specify that the status is
  17.  *        private and can not be used by other modules.
  18.  *    The module and message numbers are used to index the message array.
  19.  *
  20.  * Copyright 1986, 1988 Regents of the University of California
  21.  * Permission to use, copy, modify, and distribute this
  22.  * software and its documentation for any purpose and without
  23.  * fee is hereby granted, provided that the above copyright
  24.  * notice appear in all copies.  The University of California
  25.  * makes no representations about the suitability of this
  26.  * software for any purpose.  It is provided "as is" without
  27.  * express or implied warranty.
  28.  *
  29.  * $Header: /sprite/src/lib/include/RCS/status.h,v 1.15 92/09/21 16:40:57 mgbaker Exp $ SPRITE (Berkeley)
  30.  */
  31.  
  32. #ifndef _STATUS
  33. #define _STATUS
  34.  
  35. #ifndef _ASM
  36.  
  37. #ifndef _SPRITE
  38. #include <sprite.h>
  39. #endif
  40.  
  41. extern char *Stat_GetMsg _ARGS_((ReturnStatus status));
  42. extern char *Stat_GetPrivateMsg();
  43. extern void Stat_PrintMsg _ARGS_((ReturnStatus status, char *string));
  44.  
  45. /*
  46.  * STAT_IS_PRIVATE is TRUE if the status value is private and
  47.  *     is FALSE if the status is public.
  48.  */
  49.  
  50. #define STAT_IS_PRIVATE(status)    ((status) & 0x80000000)
  51. #define STAT_MODULE(status)    (((status)& 0x7fffffff) >> 16)
  52. #define STAT_MSGNUM(status)    ((status) & 0x0000FFFF)
  53.  
  54. /*
  55.  * stat_LastError contains the result of the last failed system call (some
  56.  * library functions may also alter its value).
  57.  */
  58. extern ReturnStatus    stat_LastError;
  59. extern void           Stat_SetErrorHandler();
  60. extern void           Stat_SetErrorData();
  61. extern void        Stat_GetErrorHandler();
  62. extern ReturnStatus    Stat_Error();
  63.  
  64. /*
  65.  * The procedures below are used to map between Sprite and UNIX
  66.  * error numbers, for the interim period before Sprite converts
  67.  * over to using UNIX error numbers.
  68.  */
  69.  
  70. extern int        Compat_MapCode _ARGS_((ReturnStatus status));
  71. extern ReturnStatus    Compat_MapToSprite _ARGS_((int unixErrno));
  72. #endif /* _ASM */
  73.  
  74. /*---------------------------------------------*/
  75.  
  76. /*    gen.stat    */
  77. #define GEN_SUCCESS                            0x00000000
  78. #define GEN_FAILURE                            0x00000001
  79. #define GEN_ABORTED_BY_SIGNAL                  0x00000002
  80. #define GEN_NO_PERMISSION                      0x00000003
  81. #define GEN_NOT_IMPLEMENTED                    0x00000004
  82. #define GEN_INVALID_ARG                        0x00000005
  83. #define GEN_TIMEOUT                            0x00000006
  84. #define GEN_EPERM                            0x00000007
  85. #define GEN_ENOENT                            0x00000008
  86. #define GEN_EINTR                            0x00000009
  87. #define GEN_E2BIG                            0x0000000a
  88. #define GEN_EAGAIN                            0x0000000b
  89. #define GEN_EACCES                            0x0000000c
  90. #define GEN_EFAULT                            0x0000000d
  91. #define GEN_EEXIST                            0x0000000e
  92. #define GEN_EINVAL                            0x0000000f
  93. #define GEN_EFBIG                            0x00000010
  94. #define GEN_ENOSPC                            0x00000011
  95. #define GEN_ERANGE                            0x00000012
  96. #define GEN_EIDRM                            0x00000013
  97.  
  98. /*    proc.stat    */
  99. #define PROC_BAD_FILE_NAME                      0x00010000
  100. #define PROC_BAD_AOUT_FORMAT                    0x00010001
  101. #define PROC_NO_SEGMENTS                        0x00010002
  102. #define PROC_CHILD_PROC                         0x00010003
  103. #define PROC_NO_EXITS                           0x00010004
  104. #define PROC_INVALID_PID                        0x00010005
  105. #define PROC_UID_MISMATCH                       0x00010006
  106. #define PROC_NO_CHILDREN                        0x00010007
  107. #define PROC_INVALID_FAMILY_ID                  0x00010008
  108. #define PROC_NOT_SET_ENVIRON_VAR                0x00010009
  109. #define PROC_BAD_ENVIRON_STRING                 0x0001000a
  110. #define PROC_ENVIRON_FULL                       0x0001000b
  111. #define PROC_INVALID_NODE_ID                    0x0001000c
  112. #define PROC_MIGRATION_REFUSED                  0x0001000d
  113. #define PROC_INVALID_STRING                     0x0001000e
  114. #define PROC_NO_STACKS                          0x0001000f
  115. #define PROC_NO_PEER                            0x00010010
  116.  
  117. /*    sys.stat    */
  118. #define SYS_ARG_NOACCESS                       0x00020000
  119. #define SYS_INVALID_ARG                        0x00020001
  120. #define SYS_INVALID_SYSTEM_CALL                0x00020002
  121.  
  122. /*    rpc.stat    */
  123. #define RPC_INVALID_ARG                        0x00030000
  124. #define RPC_NO_CHANNELS                        0x00030001
  125. #define RPC_TIMEOUT                            0x00030002
  126. #define RPC_TOO_MANY_ACKS                      0x00030003
  127. #define RPC_INTERNAL_ERROR                     0x00030004
  128. #define RPC_INVALID_RPC                        0x00030005
  129. #define RPC_NULL_ERROR                         0x00030006
  130. #define RPC_PARAMS_TOOBIG                      0x00030007
  131. #define RPC_DATA_TOOBIG                        0x00030008
  132. #define RPC_NO_REPLY                           0x00030009
  133. #define RPC_SERVICE_DISABLED                   0x0003000a
  134. #define    RPC_NACK_ERROR                0x0003000b
  135. #define    RPC_FS_NO_PREFIX            0x0003000c
  136.  
  137. /*    fs.stat    */
  138. #define FS_NO_ACCESS                          0x00040000
  139. #define FS_INVALID_ARG                        0x00040001
  140. #define FS_REMOTE_OP_INVALID                  0x00040002
  141. #define FS_LOCAL_OP_INVALID                   0x00040003
  142. #define FS_DEVICE_OP_INVALID                  0x00040004
  143. #define FS_NEW_ID_TOO_BIG                     0x00040005
  144. #define FS_MASTER_CLOSED                      0x00040006
  145. #define FS_BROKEN_PIPE                        0x00040007
  146. #define FS_NO_DISK_SPACE                      0x00040008
  147. #define FS_LOOKUP_REDIRECT                    0x00040009
  148. #define FS_NO_HANDLE                          0x0004000a
  149. #define FS_NEW_PREFIX                         0x0004000b
  150. #define FS_FILE_NOT_FOUND                     0x0004000c
  151. #define FS_WOULD_BLOCK                        0x0004000d
  152. #define FS_BUFFER_TOO_BIG                     0x0004000e
  153. #define FS_IS_DIRECTORY                       0x0004000f
  154. #define FS_NOT_DIRECTORY                      0x00040010
  155. #define FS_NOT_OWNER                          0x00040011
  156. #define FS_STALE_HANDLE                       0x00040012
  157. #define FS_FILE_EXISTS                        0x00040013
  158. #define FS_DIR_NOT_EMPTY                      0x00040014
  159. #define FS_NAME_LOOP                          0x00040015
  160. #define FS_CROSS_DOMAIN_OPERATION             0x00040016
  161. #define FS_TIMEOUT                            0x00040017
  162. #define FS_NO_SHARED_LOCK                     0x00040018
  163. #define FS_NO_EXCLUSIVE_LOCK                  0x00040019
  164. #define FS_WRONG_TYPE                         0x0004001a
  165. #define FS_FILE_REMOVED                       0x0004001b
  166. #define FS_FILE_BUSY                          0x0004001c
  167. #define FS_BAD_SEEK                           0x0004001d
  168. #define FS_DOMAIN_UNAVAILABLE                 0x0004001e
  169. #define FS_VERSION_MISMATCH                   0x0004001f
  170. #define FS_NOT_CACHEABLE                      0x00040020
  171. #define FS_NO_REFERENCE                      0x00040021
  172. #define FS_RECOV_SKIP                          0x00040022
  173.  
  174. /*    vm.stat    */
  175. #define VM_WRONG_SEG_TYPE                     0x00050000
  176. #define VM_SEG_TOO_LARGE                      0x00050001
  177. #define VM_SHORT_READ                         0x00050002
  178. #define VM_SHORT_WRITE                        0x00050003
  179. #define VM_SWAP_ERROR                         0x00050004
  180. #define VM_NO_SEGMENTS                        0x00050005
  181.  
  182. /*    sig.stat    */
  183. #define SIG_INVALID_SIGNAL                     0x00060000
  184. #define SIG_INVALID_ACTION                     0x00060001
  185.  
  186. /*    dev.stat    */
  187. #define DEV_DMA_FAULT                          0x00070000
  188. #define DEV_INVALID_UNIT                       0x00070001
  189. #define DEV_TIMEOUT                            0x00070002
  190. #define DEV_OFFLINE                            0x00070003
  191. #define DEV_HANDSHAKE_ERROR                    0x00070004
  192. #define DEV_RETRY_ERROR                        0x00070005
  193. #define DEV_NO_DEVICE                          0x00070006
  194. #define DEV_INVALID_ARG                        0x00070007
  195. #define DEV_HARD_ERROR                         0x00070008
  196. #define DEV_END_OF_TAPE                        0x00070009
  197. #define DEV_NO_MEDIA                           0x0007000a
  198. #define DEV_EARLY_CMD_COMPLETION               0x0007000b
  199. #define DEV_NO_SENSE                           0x0007000c
  200. #define DEV_BLANK_CHECK                        0x0007000d
  201. #define DEV_BUSY                0x0007000e
  202. #define DEV_RESET                0x0007000f
  203.  
  204. /*    net.stat    */
  205. #define NET_UNREACHABLE_NET                    0x00080000
  206. #define NET_UNREACHABLE_HOST                   0x00080001
  207. #define NET_CONNECT_REFUSED                    0x00080002
  208. #define NET_CONNECTION_RESET                   0x00080003
  209. #define NET_NO_CONNECTS                        0x00080004
  210. #define NET_ALREADY_CONNECTED                  0x00080005
  211. #define NET_NOT_CONNECTED                      0x00080006
  212. #define NET_ADDRESS_IN_USE                     0x00080007
  213. #define NET_ADDRESS_NOT_AVAIL                  0x00080008
  214. #define NET_BAD_PROTOCOL                       0x00080009
  215. #define NET_BAD_OPERATION                      0x0008000a
  216. #define NET_BAD_OPTION                         0x0008000b
  217.  
  218.  
  219. /*---------------------------------------------*/
  220.  
  221. #endif /* _STATUS */
  222.